#ifndef _BSP_RS485_H_
#define _BSP_RS485_H_

#include <stdint.h>
#include <stdbool.h>

#define UART_TX_RX_BUFFER_SIZE 200 // 定义最大发送接收字节数 200

typedef struct
{
    uint8_t u8UartRecvCnt;
    uint8_t u8rx_ok;
    uint8_t u8UartData[UART_TX_RX_BUFFER_SIZE];

    void (*fdeinit)(void);
    void (*finit)(uint32_t);
    void (*fclear)(void);
    void (*fRxPinCtrl)(bool);
    uint8_t (*fwrite_byte)(uint8_t);
    uint8_t (*fwrite_data)(uint8_t *, uint16_t);
    uint8_t (*fwrite_string)(uint8_t *);
    uint16_t (*fread_data)(uint8_t *pData, uint16_t Timeout);
} dv_UART_TypeDef;

extern dv_UART_TypeDef dv_UART;
extern void init_dv_UART(void);

#endif